package hub.cathome.entity;

public class Page {
    private int size;
    private int pageNumber;
    private int pageSize;
    private int currentBegin;
    private String pageFor;
    private int maxPage;

    public Page() {
    }

    public int getMaxPage() {
        return maxPage;
    }

    public void setMaxPage(int maxPage) {
        this.maxPage = maxPage;
    }

    public Page(int size, int pageNumber, int pageSize, int currentBegin, String pageFor) {
        this.size = size;
        this.pageNumber = pageNumber;
        this.pageSize = pageSize;
        this.currentBegin = currentBegin;
        this.pageFor = pageFor;
    }
    public void setPage(int pageNumber,int pageSize){
        this.pageNumber = pageNumber;
        this.pageSize = pageSize;
        currentBegin = (pageNumber-1)*pageSize;
    }
    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
        currentBegin = (pageNumber-1)*pageSize;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentBegin() {
        return currentBegin;
    }

    public void setCurrentBegin(int currentBegin) {
        this.currentBegin = currentBegin;
    }

    public String getPageFor() {
        return pageFor;
    }

    public void setPageFor(String pageFor) {
        this.pageFor = pageFor;
    }

    @Override
    public String toString() {
        return "Page{" +
                "size=" + size +
                ", pageNumber=" + pageNumber +
                ", pageSize=" + pageSize +
                ", currentBegin=" + currentBegin +
                ", pageFor='" + pageFor + '\'' +
                '}';
    }
}
//spring /spring mvc /mybatis
